class Animal:
    type = "动物的类型"
    # ethnic = "狗"
    def __init__(self,name,color,sex,ethnic):
        self.name = name
        self.color = color
        self.sex = sex
        self.ethnic = ethnic

    def to_String(self):
        print("这是一个{}，它叫{}，是一个{}的{}的小{}".format(self.ethnic,self.name,self.sex,self.color,self.ethnic))

    @classmethod
    def eat(cls):  # cls参数表示类对象
        print("动物要吃法")
        # print(cls.ethnic)
        print(cls.type)
        # print(cls.name)  # 类方法只能访问类变量，不能访问实例变量
        cls.type = "动物的种类"

    @staticmethod
    def sleep():
        print("动物要睡觉")
        # print(cls.type)
        # print(self.color)